<extend name="Layout/ins_popup" />
<block name="content">
	<div class="popup-fixed">
		<div class="popup-header clearfix">
			<div class="pull-left">
				<h1>{$vo['name']}</h1>
			</div>
			<div class="pull-right">
				<notempty name="prev">
					<a onclick="prev();" class="btn btn-sm btn-primary">上一个</a>
				</notempty>
				<notempty name="next">
					<a onclick="next();" class="btn btn-sm btn-primary">下一个</a>
				</notempty>
				<a onclick="del();" class="btn btn-sm btn-danger">删除</a>
				<a onclick="edit();" class="btn btn-sm btn-primary">编辑</a>
				<a onclick="myclose();" class="btn btn-sm btn-default">关闭</a>
			</div>
		</div>
		<div class="popup-body" style="height: 420px;overflow-y: auto;">
			<form id="form_data" name="form_data" method="post" class="form-horizontal clearfix">
				<input type="hidden" id="ajax" name="ajax" value="0">
				<div class="form-group col-xs-6">
					<label class="col-xs-4 control-label" >开始:</label>
					<div class="col-xs-8">
						<p class="form-control-static">
							{$vo.start_time|substr=0,16}
						</p>
					</div>
				</div>
				<div class="form-group col-xs-6">
					<label class="col-xs-4 control-label" for="name">结束:</label>
					<div class="col-xs-8">
						<p class="form-control-static">
							{$vo.end_time|substr=0,16}
						</p>
					</div>
				</div>
				<div class="form-group col-xs-6">
					<label class="col-xs-4 control-label" for="name">地点:</label>
					<div class="col-xs-8">
						<p class="form-control-static">
							{$vo.location}
						</p>
					</div>
				</div>
				<div class="form-group col-xs-6">
					<label class="col-xs-4 control-label" for="name">优先级:</label>
					<div class="col-xs-8">
						<div class="form-control-static" >
							<input type="hidden" id="priority" name="priority"/>
							<div class="slider_box" >
								<div class="left" >
									低
								</div>
								<div id="basic_slider"></div>
								<div class="right" >
									高
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-2 control-label" for="name">参与人员:</label>
					<div class="col-xs-10">
						<p class="form-control-static">
							{$vo.actor|show_contact}
						</p>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-2 control-label" for="name">附件:</label>
					<div class="col-xs-10">
						{:W('FileUpload/view',array('add_file'=>$vo['add_file']))}
					</div>
				</div>
				<div class="clearfix"></div>
				<div class="form-group">
					<div class="col-xs-12">
						<div class="content_wrap" >
							<iframe class="content_iframe"></iframe>
							<textarea  class="content" name="content" style="display:none;">{$vo.content}</textarea>
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		function edit() {
			parent.window.location.href = '{:U("edit","id=".$vo["id"])}';
			myclose();
		}

		function del() {
			parent.window.location.href = '{:U("del","id=".$vo["id"])}';
			myclose();
		}

		function next() {
			window.location.href = "{:U('read','id='.$next.'&list='.$list)}";
		}

		function prev() {
			window.location.href = "{:U('read','id='.$prev.'&list='.$list)}";
		}

		$("#basic_slider").on('change', function() {
			$("div.slider_box .noUi-base").css("background-color", schedule_bg($(this).val()));
		});

		$(function() {
			show_content();
			$("#basic_slider").noUiSlider({
				start : '{$vo.priority}' * 1,
				step : 1,
				range : {
					'min' : 1,
					'max' : 5,
				},
			});

			$("div.slider_box .noUi-base").css("background-color", schedule_bg('{$vo.priority}'));
		});

	</script>

</block>
